using StructureMap;
using System;
using System.Data.Entity;
using Trauberman.SOChat.StarLeaderboard.Data;
using Trauberman.SOChat.StarLeaderboard.Domain;
using Trauberman.SOChat.StarLeaderboard.Services;
namespace Trauberman.SOChat.StarLeaderboard
{
	public static class IoC
	{
		private static DataContext _dataContext = new DataContext();

		public static IContainer Initialize()
		{
			ObjectFactory.Initialize(x =>
						{
							x.Scan(scan =>
									{
										scan.TheCallingAssembly();
										scan.WithDefaultConventions();
									});

							x.For<IUserService>().Use<UserService>();
							x.For<IStarService>().Use<StarService>();
							x.For<IChatroomService>().Use<ChatroomService>();
							x.For<IDataContext>().Use(_dataContext);
						});
			return ObjectFactory.Container;
		}
	}
}